refactor gson to abstract serializer (xml/json)