refactored queue remove