moving final queue logic to queue.js and modifying logging.
moving relations logic here.