Clean: pipeline the main function