minor refactor: improved error message in utility method,