refactoring list operations