very slightly better routing and error handling