Remove a lot of useless code

This is mostly code that came from the copy & paste from barclamp-nova.
Remove unneeded variable
Use loops to make code a bit more readable
Merge pull request #4 from vuntz/cleanup-cookbook

Remove a lot of useless code