Reduce cyclomatic complexity