refactor recipe handling