IMO it'd be clearer to have these above the functions rather than below, so a reader can see what variables are shared as opposed to local.