Refactored method and reduced cyclomatic complexity. Fixes #2
Incremented version