Cleaning up mostly unnecessary or wrongfully placed code