Refactoring

Further refactored the login code to an oop design. Will need to further
refactor the class when possible.