Make the customcrafting code much cleaner