Further work cleaning up protocol layer