we can directly use getProcessElement here and reduce some lines of code