Looks great & efficient. Nice find Naji.
I will do the same thing just like You do. See over old projects then experiment with existing codes.
When re-look again to my project, I always thought I can optimize & reduce bunch lines of code.
At the time I understand how loop & iteration work, everything change in my mind as if I could see every single pattern.