Clear up some logic