simplify code. add build script