A new program complex for macromolecular refinement is described. The kernel of the complex is the program FROG2 to refine proteins, RNA and other biopolymers. Its high-speed operation is due to the fast differentiation and the fast Fourier transform algorithms it uses. A model can be described along four levels: generalized parameters, atomic parameters, density distribution and diffraction parameters. The functional to be minimized is set by special reference files which make it easy to modify. The functional consists of many criteria; some of them, such as the phase criterion, are new; others, the density criterion and intermolecular interaction, are encountered, though not very often; and the rest of them are familiar, like R-factor, bond-length or bond-angle restraints. A model may be a mixture of individual atoms and rigid groups, each group including an arbitrary number of atoms. The complex has a routine to organize atoms into rigid groups for the most common situations. The FROG2 program does not in practice restrict model size or space group. However, it takes account of symmetry, which gives another reduction of computing time. The program does not require special effort to adapt it to any memory. It can easily be extended by new criteria, atomic types, and more effective algorithms for calculating electron density or Fourier transform may be included. Finally, program blocks may be used in other programs, e.g. those for phase refinement.