Making exception handling better