ps module: simplify by using list comprehensions