Better use of the User object, refactoring