Add browsing by topic option. Code refactoring