Modularized the game into a class