Prevent lose, then win bug.
Refactor some game logic into separate class.