Refactoring of cpu methods. Event system for cpu sleeping