Changing a bit game logic and refactoring a bit