ClassSerializer for serializing