modularized the game