Refactoring posts collection