refactored and moved deployment stages