Extract topic to a class so it matches queue
Subdirected code
Merge pull request #2 from iHiD/rearrange_code

Restructured the code