add file process with functional style,like local function,first-class function