add some sleep to build command and clean up some code