Cleanup various pieces of corelib code