Code format changes: ; char in line ends, 
variables renamed, 
blank lines between logical blocks
unified custom elements names
and more changes according to Dominic's notes