Can we move this to Atomic.scala?