Implemented logic for registration handling.