adapt for multiple categories