Separating the code utilizing the QR Code library and making it conditional