Refactor DE/best/1/eig optimization codes.