removing group by statements