Reworked enchantment code