Modernise; add base64 encoding handler