extract function into file part