refactored displaying topology