core-4847 add logic to handle multiple categories