Clean some logic