initial js dom refactorization