refact(angularjs/getModuleInfo): extract behaviour into reusable methods