Various improvement to cookbook

I made this changes some time ago and never did a PR. Now I'm doing that because I'd like to get this merged and released in the official cookbook.

All the changes should be compatible and do not change default behavior in your cookbook.

Let me know if you are interested in these changes or if there is something to improve.