Optimized version directory search