part of #275, after #194
part of #275, after #194