created the basic serializer implementation
some more polymorhism and templates magic