code refactoring for the new registration.