Remove unused includes
Combine common abort connection logic into helper function