Multiple improvements

Removed redundant code
Improved readability