use auto and remove some repetitions