JS update 1
General refactoring