optimize how stack traces are created