Merge pull request #161 from jdegoes/ready/157

Part of #157
remove some very horrible code, a little work toward merging multiple groupings but it's too difficult for this ticket, fixes #157