CProfile refactoring