[cpp engine] complete refactoring;