Replace meta refresh by turbolinks
Refactor javascript