turns out that using is is kinda bad (two casts versus one), so changing to typeof for now