Split pipeline in smaller functions and sketch some semantic ideas.