Finished rewriting to new model