refactor queue controller