This paper describes a new approach for solving OPF problems, using a combination of "black-box" tools for optimization and automatic code-generation for first order derivatives. The efficiency of the new code will be evaluated in terms of maintainability, flexibility and speed. These code properties are relevant and useful considering the increasing need for easy-to-handle software tools, to integrate new models and objectives derived from the new open energy market environment, with only standardized, minimal changes for the software developer.