simplify a couple of test helpers (DRY)