Rearrange some code in ingredientsDAO