Refactor adding the persistence adapter to Spirit