Refactoring of some topics functions