lowering CPU usage by means of a number of optimizations