Convert more user code to model based