sign in and signup refactoring