optimization to reduce references to permutation table