a basic utility function for composing cascade flowes between functions