Clean up code and fix issue with config loader not being able to load multiple protocol definitions