Modified reconnect timertask functions to prevent code duplication