remove duplication

DRY it up a little bit