format
refactor triggers and fix filtering trigger