try to solve cyclomatic complexity