refactored queue to its own file