refactor queue item controller code to get easy review