MIP refactoring complete. Main file fully cleaned.