Implementing solver interfaces that utilize templates could significantly improve performance (including memory consumption).