rewrite blog persistence code