Created another generic method to take the place of a operation repeated in multiple places