Move validation rules from controller to model.