Kh th wpm results

What if you did {render json: SpeedTestCalculator(params).calculate.to_json }

and then wrote a class to abstract out all this logic from a controller.