[PATCH 1/2] Replace filter() call with list comprehension