all group classifier stuff in single function