Remove unused midpoint code