Executing code with triggers