[Refactor][Engine] Refactor engine module (#581)