clean up getShortUrl function