Cookbook refactoring