WIP refactor deployment controller