Refactor for Connection