def clean_stacks(self, stacks: List[List[BaseLayer]]) \
            -> List[List[BaseLayer]]:
        """
        Two cases: if a stack finishes by a sleep then let's keep it (it means
        that there was nothing after the text). However if the stack finishes
        with something else (like a quick reply) then we don't risk an
        is preserved.
        """

        ns: List[List[BaseLayer]] = []

        for stack in stacks:
            if isinstance(stack[-1], lyr.Sleep):
                ns.extend([x] for x in stack)
            else:
                ns.append([x for x in stack if not isinstance(x, lyr.Sleep)])

        if not ns:
            return ns

        last = ns[-1]
        if len(last) == 1 and isinstance(last[0], lyr.Sleep):
            return ns[:-1]
        else:
            return ns
Two cases: if a stack finishes by a sleep then let's keep it (it means
        that there was nothing after the text). However if the stack finishes
        with something else (like a quick reply) then we don't risk an
        is preserved.