Refactor views and add app js