better error handling, less verbose