extract build steps into a single script