connection refactoring
added connection interface