Refactoring the NeuralNetwork