RFR: Refactored the optimizer classes into a module