Simplify the code, removing redundant code where it is possible
Remove redundant code, p.2
Doc string
Indentation fix