refactor neighbor module(untest)