change the signature of modify so that user can avoid unnecessary deserialization overhead.