lowering cyclomatic complexity a tiny bit further