register refactoring