removed base64 and some code optimization