Better closure serialization