Refactoring register and edit profile