optimizing game update logic