Modified to work with the new ItemType enum.