Moved more dead code into core, merged functions