Move the remapping code into a separate file. Have functions to install custom init functions that can install optimized versions, when they want.