First pass at removing unnecessary code.