refactor access checking as precursor to moving it out