Refactored for disconnect investigation