Get rid of dependency on array