refactor game.c a little bit