Updated exception handling. Introduced StackWalker to extract stack traces rather than having catch spread throughout the code.