add group,having, select and trying to refactor out build clauses