reduced NSError generation code