DRY out the code