refactor deploy script.