Further work towards #22 and #23