refactored User class