Addressed groups code review.

This is just a clean up commit before merging. Added helper
methods and made things look nicer.

* Cleaned up code
* Added helper methods
* Removed some unnecessary code