Refactored conn module.