register method, refactoring