General tidy up, rearranged classes.