remove unnecessary array cloning