Extract trigger registration function