improved exception cases and design