Code clean up for creating a protocol