print array refactoring; duplicating array refactoring