re-working module and type level initialization and finalization