reduce functions in game.cpp