refactoring sign_in