Replaced usage of map with generator expression