Issue #20 - Reduce cyclomatic complexity