Extract method.

Refactor out some duplicate code between getModuleSetting and
getModuleSettings()