Repository: refactored code, added dragdrop handlers, enhanced UI