refactor the code by http://jsbeautifier.org/