3 Divide engine class and refactoring