Persistence refactoring