refactored topic controller