Some refactoring and check for lower triangular.