Deploy.js refactoring