DOM listener.
Refactoring.