Deployment refactor

https://jira.spring.io/browse/XD-1485
https://jira.spring.io/browse/XD-1483