refactor main adapter & serializer