Some improvements for neighbors module: proper constness and references