Rewrite of build and run scripts