DRY up protocol registration into a small DSL.