Refactored duplicate code calculating net_usage_rate_average_in_kilobytes_per_second