introduce ui class. decouple game logic and ui