partial merge of pr/59