move game logic from app view