Various CPUSensors optimizations and code cleanup