basic connector functionality. cleaned code