Small refactoring to prepare to multiple engines.