refactor: move persistence wiring into services (#2562)