refactoring posts and comments