Changed the implementation of the order bys/group bys