Seperate module for ANN and refactored some code