refactor cpu class