Remove duplicate code in topic()
Merge pull request #241 from MorrisJobke/remove-duplication

Remove duplicate code in topic()