Refactor of deploy process.