Refactore connect functionality and buffer service
Merge remote-tracking branch 'origin/master'