Code cleanup, queue & task cleanup