Refactor ml

test PR to analyze the diff conveniently