splitting process to several functions