Removing redudant code