reformat and memory finalizations