redo trigger handling to not use funs.