splitting off internal functions for topic operations

also more linting