refactor the drag