implement topic operations, refactor