Refactor root assignment to be more explicit

I found the serializer root assignment a little confusing, so I refactored it to be more explicit about what's going on.