Remove unused function
Refactor simple function
Make simple function one-liners
Remove obsolete comments
Redraw when dom changes (use dom change event)