Moved here from remap_namespace in case you're confused. I tried to consolidate all special purpose code into  one place rather than the 3 it was in.