JAL-591 utility method renamed and slightly generalised