split game logic to static library