factor out common list change handler