Modification to avoid buffer copy for increasing perf