Refactoring in processor.cc (v2)