tries to shorten hostnames while keeping them meaningful