Use loops, code tidy-up.