Improving handling of arrays