Updating to new persitence api