error handling and logging universalized