refactor js.erb files