part of #275, after #193
part of #275, after #193