Move logic out of Mongoose into User model