Add destructuring to functions