refactored User.js