game refactor