use a higher-order function to deduplicate pipeline