refactored topology and neighbordb