refactored topics_controller