Move serialization to Block class