clean up the Base64 encoding code