Refactored to use the new registerEncoder/registerDecoder API.