Code cleanup on CompileStateTracker and Core