wip
split out persistence stuff