Partb of #341