Use list comprehension for optimization