admin: Factor out and unify reference lookup.