registration refactoring