reorganized structure to localize all machine learning code