small improvements in queue & code cleanup