Optimized set.js