Refactored engine tests