User sign in refactoring