protected function populateModuleCollection()
    {
        $this->modules = new Collection;

        foreach ($this->moduleClasses as $moduleClass) {

            $instance = $this->instantiateClass($moduleClass);

            if ($instance instanceof ModuleGeneratorInterface) {
                $this->storeModulesForGenerator($instance);
                continue;
            }

            // instance is a module
            $this->storeModule($instance);
        }

        return $this;
    }