Js/refactor view