big refactor to split mappers into serializers/deserializers and separate the public interface used for generators