nearest_connectors: wip: refactoring