Cleanup and rearranging. Group vs partnership fix

Massive cleanup and rearranging. Group vs partnership fix