to_model implementation