legacy code removed, exception factory added