some cleanup with atomics