Move validation to model.