Fix class names & improve serialization