It would probably be better to move this logic to the recipe.