cleaned up code and added routes