queue logic to separate module