engine-refactor: separate engine factory from engine handler, cpp
refactory.