move onDelete/onUpdate inside reference