Refactored deep neural network.