minor refactor, error message consistency