Even though these functions are only used within this method, I'd still make them "private" methods on the class, just to put all the method definitions in the same place.  Plus, they are redefined every time the `url()` method is called.