[Upg] refactoring js