refactoring tests, writing tests login