Move array functions to utility service