seperate the functions into several independent cpps