performance improvement, removed base64 dependency, data structure unification