A smart solution for shortening links