user js refactor