Refactor registration, authentication tests