Allow for trigger to be specified through function