use curry2 to remove boilerplate