Cleaning up the AST to more uniformly handle projections