Calculate efficiency; tidy code.