Errors are handled more gracefully with file writing + file ext support