Adapt sortAndCkeck components for structurals and improve implementation
performance