Refactor old code by removing excessive StandardDeviation.new calls