Refactored queue, pushed implementation into controller