fix #925 and consolidate visibility checking on RefinementVisitor