Imrpove multi-threadedness and revert formatting change