Refactor `TopicsController` and remove code duplication
Merge pull request #1041 from vipulnsward/refactor_topics_controller

Refactor `TopicsController` and remove code duplication