finish refactoring of atomic operations