Reference exceptions explicitly and remove unnecessary import