refactor augmenting to a function