refactored deploy templates