Refactored magic registration to increase clarity