refining exception handling