minor refactor (DRY)