Refactoring and creating topology service