Moving validation to model.