clean up category aggregation and add debug back door