refactor deploy script