Re-construct ml package, extract duplicate code.
Add a temp class for further update