Refactor item type processing