refactor ast:in/out triggers