Refactored in deque