refactor into array