refactored deploy