Captures and cleans stack traces