Minor refactoring of the deploy task