Optimization for less CPU usage.