refactor - index view and js controllers