re-order the workflow of some processes
use atomic function for the calculation
add lock to renew operation