Refactoring

Type-safety

Minor performance improvements
Merge pull request #532 from thatsIch/e-nexttry

Refactoring, Type-safety, Minor performance improvements