refactor prototol, make it fast.