Refactorized: DMOPSO and related classes