Refactored Code/Random traffic generator