implement @adamrp suggestions