Refactored from 'login' to 'register'