Refactored Connection test