refactoring to remove double negative and bring clarity to error handling