style nit: reorder these arms (None/error handling should come last)