Merging machine learning algorithms and some code cleaning