refactor engine project