refactor neighbor module--version 2