refactor buildscripts out from spec