cleanup, tested exception-handling