clean up and integration with exception system