tweak the way module extension works and delete old code