cleaned out duplicated functions