Add concurrency to binarize

Refactor code for better readability (at the cost of performance)