Removed some duplication and improved logic
Merge pull request #1 from omgmog/patch-1

Removed some duplication and improved logic