Started refactoring of deque