Separated game loop from connection