ast refinement checkpoint
some cleanup for the refinement code