small refactor to the engines