slight improvements to previous commit