refactoring posts