More refactoring

adding a Json serializer