view and js refactoring