create a generic applier function