Flatten categories