A B S T R A C TThis paper describes a few mild design constraints that permit rapid adaptation of the modelling code for linear wave propagation to imaging/inversion or design optimization applications, retaining parallelism and other performance enhancements of the underlying simulator. It also describes an abstract software framework preserving the modularity of both optimization and modelling software in building inversion applications and illustrates this possibility via an example framework implemented in C++. Wave inverse problems tend to be afflicted by a variety of features, including extreme ill-conditioning and nonlinearity, which degrade the performance of optimization formulations. Extended modelling variants of least-squares inversion, motivated by migration velocity analysis, may relieve some of these difficulties. The framework described also accommodates these extensions to standard inversion.