rafactoring in game controller