refactor views and add some js