refactor tests, user login work