refactor: end game