Clean refresh vote

Remove duplication in JS
Extract track to have a more clean app.rb