Moving the logic to check for duplicate registrations into a private method