Refactoring C++ symbol match