General refactoring to dynamically get the summary of the post