Factored out standard build code