Refactored item type handling