refactor
use openmp