Cleanup unused functions and cruft in core.