events atom refactor