Metaprogram in all of the atomic operations (not in the most elegant way)