Refactoring Queue abstraction