new persistence logic - with tests.