A bit of refactoring of sign-up/sign-in functionality