Tidied up code around ttl & comments