refactor games controller