ulogin initial refactoring