Prestack modeling and migration programs can share a common structure. I outline this structure in the common shot domain for scalar or vector fields of any degree of anisotropy. The generality of the code is striking, and works for any combination of space and vector dimensionality. The actual pieces of FORTRAN 90 code are shown as listings in the paper. The advantage of this modeling strategy is that there exists only one piece of code that has to be maintained. The various media types are declared in the main program as single variables (objects), and they all use the same subroutines. The mathematical formulation is apparent in the notation and the modeling code can easily handle the usual finite differences or pseudo spectral cases or any combination. Reverse time migration is accomplished by using the same set of subroutines, conjugating of the modeling operation and additionally calculating the gradient (``imaging''). There is a trade-off between performance and common structure when, for example, the Laplacian could be used instead of in constant velocity models.