Refactor deployment script.
Write deploy method