Topic/misc refactoring