Refactored persistence test.