diff --git a/benchmarks/test_bench.py b/benchmarks/test_bench.py
index <HASH>..<HASH> 100644
--- a/benchmarks/test_bench.py
+++ b/benchmarks/test_bench.py
@@ -3,6 +3,7 @@ from __future__ import absolute_import
 import json
 import pkg_resources
 import random
+import statistics
 import string
 from collections import defaultdict
 from datetime import datetime
@@ -113,21 +114,12 @@ CHART_TEMPLATE = """
 
 
 def get_average(values):
-    length = len(values)
-    if length == 0:
+    if len(values) == 0:
         return 0
     elif AVERAGE_TYPE == 'mean':
-        return sum(values) / length
+        return statistics.mean(values)
     elif AVERAGE_TYPE == 'median':
-        values = sorted(values)
-        if len(values) % 2 == 1:
-            return values[((length + 1) / 2) - 1]
-        else:
-            return float(
-                sum(
-                    values[(length / 2) - 1:(length / 2) + 1]
-                )
-            ) / 2.0
+        return statistics.median(values)
 
 
 class BenchmarkTest(APITestCase):
Refactor `get_average` method to use `statistics` library