refactoring + new test for blog example