Handle internal classes that implement Serializable