Refactoring register
Refactoring profile and register