Refactored the protocol handling to save RAM, added Carrier support