Remove unused and pointless code