Improve atomics API