Refining crafting function.