refactor to use an app-state atom