Optimized methods like set and indexOf