Protocol enhancements and refactoring.