[ui] cleaned up drag & drop code