Makes changes based on feedback.

Replaces tabs for spaces.
Reorders method definitions.
Makes argument name match what is specified in param.
Improves check for an empty topic name when sanitizing.