polishing code for proc. file generation