refactoring login, signup