refactoring, simplifying (mainly with list comprehension)