Refactor

Refactor and perfomance test… (need a worker?)