Writing customized trigger actions (a.k.a. behaviors)