Some refactoring + start on password reset