reduce CPU usage and optimize the speed