New game loop and minor organization