Rewrote some sql queries to filter out group updates