Refactor the protocol-enabling bits into a common function, which makes
the protocol setting code easier to read/maintain.