refactoring javascript sdk in HTMLs application home#index and field#show