output file name; begin refactor work for function encapsulation