logintest refactoring