changing funtions in the name of DRY