persistence logic