Refactoring Login and Register classes into one User class