Refactor engine methods