move validation to schemas