[WIP[ Refactoring deploy