rewrited build script a bit