Initial js dom refactorization