Refactoring: adapting persistency to use memory