dead code removal.
Minor reformatting.
Make more names consistent. eg group_id