refactoring array list api