Split tokenNeighbors into multiple functions