refactoring print_cookbook to use less code and be reusable if we want to print steps elsewhere