Small refactoring of registrationService and some tests