split out persistence stuff