Added custom Kryo serialization