Refactor getContentByBlockType(...) function to overcome jshint cyclomatic complexity violation.