Made the AP singleton and used it for QR code generation