replace isFlattenable with isSequence