refactor ajax polling for game updates