Revert "further cleanups"

This reverts commit 5502e14778c8d8a87821a930cac570d80e607f5a.
Revert "optimized synchronization to work without busy loops"

This reverts commit 6f028b3424e761ca868e6bf5c285232fdb5e0b2c.