Some refactoring connected with NeuralNetTools