refactor cpu stat to compute percentage more easily