I don't mind you making this code a bit clearer (making code easier to read is almost always a good thing, provided we're not introducing new bugs).  However I will ask two things if you're going to go down this road:

- Rebase your changes against the current master. I made some changes after you started this PR dealing with heartbeats that changes this code rather significantly.
- If you're changing code that isn't related to a connection timeout - you should split those changes off into another commit.