Refactored posts route