sample generic function and pipe