Some core cleanups