Started making the code more modular
Tidied up the login route