refactor. DRY