model1 code simplification