Moved game code to separate class