NN refactor.