Incorporate changes from  willnorris`s code review feedback