Connection State refactored. Timed state and ttl refresh.