removing repetead unnecessary code