integrate pull request #135 into #136 since they touch the same files