Moving ttl and pttl code in a common method.