Add cleanArrays method