Code cleanup
Concurrency improvements