refactoring
js beutified it