lowering cyclomatic complexity a tiny bit