add high order function to provide better abstraction