Moved some functions to onNeighborChanged method