build_triggers, build_relations functions completed