def _pop(self, key, default=None):
        """
        If ``key`` is present in Zookeeper, removes it from Zookeeper and
        returns the value.  If key is not in Zookeper and ``default`` argument
        is provided, ``default`` is returned.  If ``default`` argument is not
        provided, ``KeyError`` is raised.

        :param key: Key to remove from Zookeeper
        :type key: string
        :param default: Default object to return if ``key`` is not present.
        :type default: object
        """
        path = self.__path_of(key)
        value = None

        try:
            # We need to both delete and return the value that was in ZK here.
            raw_value, _ = self.connection.retry(self.connection.get, path)
            value = self.encoding.decode(raw_value)
        except self.no_node_error:
            # The node is already gone, so if a default is given, return it,
            # otherwise, raise KeyError
            if default:
                return default
            else:
                raise KeyError

        # Made it this far, it means have a value from the node and it existed
        # at least by that point in time
        try:
            # Try to delete the node
            self.connection.retry(self.connection.delete, path)
            self.__increment_last_updated()
        except self.no_node_error:
            # Someone deleted the node in the mean time...how nice!
            pass

        return value