cleaning up the model view code