[MH] [000000] Refactor engine for testing