Code Clean up

deleted duplicated code so run better