move protocol-types into a function instead of using a hardcoded object