refactor some javascript