Refactoring categories (uses cache and new advanced api)