cleaned up redudant code