Updated routes, and organised code