Added a handy closure constructor.