Move selection to JS as helpers.js file.