refactor: Streamline AWS and Claude response handling by consolidating logic and improving error management