DDBNEXT-1005: js refactoring