Simplify and refactor deployment functions