Prevent inappropriate downgrading of ways.  Create helper subroutine to implement logic used in four places.