Code re-factoring to remove code dump in GameEngine