public function optimize (stdClass $data)
    {
        $data->modelDirectory = str_replace ('/http/controllers', '/models', $data->controllerDestination);
        $data->modelNamespace = str_replace ('\\http\\controllers', '\\models', $data->controllerNamespace);

        foreach ($data->database as $dbItem) {
            $dbItem->columns       = $this->getTableColumns ($dbItem->tableName);
            $dbItem->modelLocation = $data->modelDirectory . '/' . $dbItem->modelName . '.php';

            if (isset($dbItem->default) && $dbItem->default)
                if (isset($dbItem->multiLanguage)) {
                    $dbItem->multiLanguage->columns       = $this->getTableColumns ($dbItem->multiLanguage->tableName);
                    $dbItem->multiLanguage->modelName     = $dbItem->modelName . 'Translations';
                    $dbItem->multiLanguage->modelLocation = $data->modelDirectory . '/' . $dbItem->modelName . 'Translations.php';
                }
        }

        //TODO get default model, there can be only one
        $data->mainModel = $data->database[0];

        return $data;
    }