Refactored connection classes