refactoring drag code interface