refactor cortex and neuron