Tested and refactored saveRegistration method.