Clean some of the code