code tidy from previous commit