made the groupby and orderby be querybuilders for more wrapping and flexibility