Code refactoring and trying Encog Machine Learning library