Code cleanup in the Models and in the routes file