Better error handling, better documentation