Refactored the "adding new Ingredient logic" to a reusable common function