Refactor process for timed task