minor code simplifications, collapsed exceptions into one