implement fixes suggested in PR