refactor the code + add sensor to get hpc for core
fix reference bugs caused by the previous refactoring