Partial work towards #157