abstract out the model definition for cross-validation