Moving TPG functions out of DB into Groups.