Improve notation
Reorder vars
Refactor deployment functions