Replaced custom exceptions with built-in exceptions