removes redundant code