Improve threading for main thread?