Refactor serializer to not be coupled to the store.