public function smartBack()
    {

        // If we are on a listing page (an odd length), do the normal stuff
        // http://stackoverflow.com/a/9153969/59160
        if (count($this->links) & 1) {
            return $this->back();
        }

        // If we're on the first level detail page, do normal stuff
        if (count($this->links) === 2) {
            return $this->back();
        }

        // Otherwise, skip the previous (the listing) and go direct to the previous detail
        $urls = array_keys($this->links);

        return $urls[count($urls) - 3];
    }