Split checkTrigger into a function per trigger
Don't export refMapToList, use (^@.. itraversed) instead
Remove flatten, use (^@.. itraversed . folded) instead