Added optional protocols functionality.