Impement engine logic with OOP structure