Refactored the buildscripts on chef