Refactor

Faster + tests + benchmark