Refactoring of jsp and js.