[BUGFIX] Fix calling getInstance() twice to get ResourceFactory