internal optimization