refactoring login test