remove unused code
make mode initialization more similar across main thread and workers