Tons of changes to support categoric grouping of fields