Extracted initialization and finalization phase from _main subroutines and put it into new subroutines with suffix _initialize and _finalize.
No change in order of calculation. No change in results.
See ticket #168