Some refactoring for more efficient and consistent checking of recipe validity