took away duplicated code