optimze deploy tool, exract common code to utils, add index.js