Refactored seriazliation to be on entities for universal and consistent use.