improved exception handling, make minimal setup possible