refactor and password reset tests