split process and write functions