Optimizing function length

Using list comprehensions and break comment's lines.