Cleanup and commenting of timeout handler