Optimizations + web worker preparation