Moving event handlers to JS file.