Making the necessary classes serializable