Avoid unnecessary array copying