speed refactor on the waterfall