Move encoder to User model