Ivan's bulk action thing made generic