Refactored posts and topics controller with a common _params private method