If your stundents have trouble with the most basic part of programmging I would suggest that they should do more exercice to gain experience. Just by seeing "good code" doesn't teach them anything.
A couple of years ago I had a lot of fun solving problems (e.g. https://projecteuler.net/) with friends and to compare and discuss the solutions we've chosen.
I'm going through the source code. It looks indeed well-written and structured. Its function is a bit difficult to catch the students' imagination, but I think I can make a good case for it.