moves gameid parsing to function