Restructured to allow for the optional exception handling