small refactor

Started to add the selectors into the js to abstract them from the
functions. No real benefit at the moment but stops me crying about magic
strings.