major refactor to worker js, changed refork behavior
major refactor to worker js, changed refork behavior