make refid lookup smoother