Made ItemUtil neater by using a switch instead of if's