trivial refactoring
still unstable behavior, move all tasks to queue
moved all tasks to queue, simplify, but still unstable