Optimize determination of visibility