Some refactoring. Some fleshing out
Renamed Protocol to Connection because reasons