table header beauty
reorganize js code