Lots of refactoring, adding reset password feature