refactored JS
started view class refactoring