improve error handling
extra seq ops
Replace most sys.error messages with specific Exceptions.