refactoring to support list operation