Remove duplicate code in topic()

cc @daboross

Superseeds #225