User model code cleanup