small refactoring on engine test