UP: Refactored topic writing