public function engine($engineIdent = null)
    {
        if ($engineIdent === null) {
            $engineIdent = $this->defaultEngine();
        }
        if (!is_string($engineIdent)) {
            throw new InvalidArgumentException(
                'Invalid engine identifier (must be a string)'
            );
        }

        if (!isset($this->engines[$engineIdent])) {
            throw new InvalidArgumentException(
                sprintf('No configured engines matching "%s"', $engineIdent)
            );
        }
        return $this->engines[$engineIdent];
    }