made it protocol agnostic