refactored topology building to deploy in production