Added support for stack trace resolve #7
a little bit of refactoring