Fixed instantiation bug by refactoring Registry class