cleaned some redundant code