fixed cyclomatic complexity