Splitting apart waterfall into separate functions