Shouldn't this be a function inside the User model?