refactoring for post blog