refactoring registration