refactoring and cleaning up to make it more compliant with dhtmlx standard deployment