rework triggerfactory logic