Minor refactoring for post_detail