Attempt to reduce cyclomatic complexity