small refactoring in ch10 drag and drop