Clean up some logic.