Updated protocol and a small amount of cleaning up code and protocols