Refactor of qr modal and auto-copy feature